
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>006循环结构 · 书名</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="作者">
        <meta name="identifier" content="图书编号" scheme="ISBN">
        
    
    <link rel="stylesheet" href="../../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-search-pro/search.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-code/plugin.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-back-to-top-button/plugin.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-intopic-toc/style.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-flexible-alerts/style.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-expandable-chapters/expandable-chapters.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-theme-comscore/test.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="007数组.html" />
    
    
    <link rel="prev" href="005选择结构.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../../">
            
                <a href="../../">
            
                    
                    书名
            
                </a>
            

            
        </li>
    

    
        
        <li class="header">Books</li>
        
        
    
        <li class="chapter " data-level="2.1" >
            
                <span>
            
                    
                    Java
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1.1" data-path="001环境变量.html">
            
                <a href="001环境变量.html">
            
                    
                    001环境变量
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.2" data-path="002Java初体验.html">
            
                <a href="002Java初体验.html">
            
                    
                    002Java初体验
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.3" data-path="003变量命名及数据类型.html">
            
                <a href="003变量命名及数据类型.html">
            
                    
                    003变量命名及数据类型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.4" data-path="004运算符.html">
            
                <a href="004运算符.html">
            
                    
                    004运算符
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.5" data-path="005选择结构.html">
            
                <a href="005选择结构.html">
            
                    
                    005选择结构
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="2.1.6" data-path="006循环结构.html">
            
                <a href="006循环结构.html">
            
                    
                    006循环结构
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.7" data-path="007数组.html">
            
                <a href="007数组.html">
            
                    
                    007数组
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.8" data-path="008类和对象方法.html">
            
                <a href="008类和对象方法.html">
            
                    
                    008类和对象方法
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.9" data-path="009构造方法.html">
            
                <a href="009构造方法.html">
            
                    
                    009构造方法
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.10" data-path="010封装与关键字static.html">
            
                <a href="010封装与关键字static.html">
            
                    
                    010封装与关键字Static
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.11" data-path="011 继承.html">
            
                <a href="011 继承.html">
            
                    
                    011 继承
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.12" data-path="012方法重写.html">
            
                <a href="012方法重写.html">
            
                    
                    012方法重写
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.13" data-path="013多态.html">
            
                <a href="013多态.html">
            
                    
                    013多态
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.14" data-path="014抽象类抽象方法.html">
            
                <a href="014抽象类抽象方法.html">
            
                    
                    014抽象类抽象方法
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.15" data-path="015接口.html">
            
                <a href="015接口.html">
            
                    
                    015接口
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.16" data-path="016异常.html">
            
                <a href="016异常.html">
            
                    
                    016异常
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.17" data-path="017集合.html">
            
                <a href="017集合.html">
            
                    
                    017集合
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.18" data-path="017集合2.html">
            
                <a href="017集合2.html">
            
                    
                    017集合2
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.19" data-path="018泛型.html">
            
                <a href="018泛型.html">
            
                    
                    018泛型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.20" data-path="019Collections算法类.html">
            
                <a href="019Collections算法类.html">
            
                    
                    019Collections算法类
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.21" data-path="020枚举.html">
            
                <a href="020枚举.html">
            
                    
                    020枚举
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.22" data-path="021包装类.html">
            
                <a href="021包装类.html">
            
                    
                    021包装类
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.23" data-path="022常用类.html">
            
                <a href="022常用类.html">
            
                    
                    022常用类
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.24" data-path="023File类.html">
            
                <a href="023File类.html">
            
                    
                    023File类
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.25" data-path="024IO流.html">
            
                <a href="024IO流.html">
            
                    
                    024IO流
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.26" data-path="025多线程.html">
            
                <a href="025多线程.html">
            
                    
                    025多线程
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.27" data-path="025多线程线程池.html">
            
                <a href="025多线程线程池.html">
            
                    
                    025多线程线程池
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.28" data-path="026网络编程Socket.html">
            
                <a href="026网络编程Socket.html">
            
                    
                    026网络编程Socket
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.29" data-path="027XML解析.html">
            
                <a href="027XML解析.html">
            
                    
                    027XML解析
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.30" data-path="028 注解.html">
            
                <a href="028 注解.html">
            
                    
                    028 注解
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.31" data-path="029 Lambda表达式.html">
            
                <a href="029 Lambda表达式.html">
            
                    
                    029 Lambda表达式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.32" data-path="029 反射.html">
            
                <a href="029 反射.html">
            
                    
                    029 反射
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.2" >
            
                <span>
            
                    
                    Mybatis
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.2.1" data-path="../mybatis/MyBatis.html">
            
                <a href="../mybatis/MyBatis.html">
            
                    
                    MyBatis
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.2.1.1" >
            
                <span>
            
                    
                    MyBatis
            
                </span>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.3" >
            
                <span>
            
                    
                    Mysql
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.3.1" data-path="../mysql/01 SQL通用语法.html">
            
                <a href="../mysql/01 SQL通用语法.html">
            
                    
                    01 SQL通用语法
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.3.2" data-path="../mysql/02 DDL.html">
            
                <a href="../mysql/02 DDL.html">
            
                    
                    02 DDL
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.3.3" data-path="../mysql/03 DML.html">
            
                <a href="../mysql/03 DML.html">
            
                    
                    03 DML
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.3.4" data-path="../mysql/04 DQL.html">
            
                <a href="../mysql/04 DQL.html">
            
                    
                    04 DQL
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.3.5" data-path="../mysql/05 DCL.html">
            
                <a href="../mysql/05 DCL.html">
            
                    
                    05 DCL
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.3.6" data-path="../mysql/06 函数.html">
            
                <a href="../mysql/06 函数.html">
            
                    
                    06 函数
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.3.7" data-path="../mysql/07 约束.html">
            
                <a href="../mysql/07 约束.html">
            
                    
                    07 约束
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.3.8" data-path="../mysql/08 多表查询.html">
            
                <a href="../mysql/08 多表查询.html">
            
                    
                    08 多表查询
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.3.9" data-path="../mysql/09 事务.html">
            
                <a href="../mysql/09 事务.html">
            
                    
                    09 事务
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.3.10" data-path="../mysql/999zzz.html">
            
                <a href="../mysql/999zzz.html">
            
                    
                    999zzz
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.3.11" data-path="../mysql/MySql.html">
            
                <a href="../mysql/MySql.html">
            
                    
                    MySql
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.3.12" data-path="../mysql/sql.html">
            
                <a href="../mysql/sql.html">
            
                    
                    Sql
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.4" >
            
                <span>
            
                    
                    Spring
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.4.1" data-path="../spring/spring.html">
            
                <a href="../spring/spring.html">
            
                    
                    Spring
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.5" >
            
                <span>
            
                    
                    SpringMVC
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.5.1" data-path="../springMVC/springMVC.html">
            
                <a href="../springMVC/springMVC.html">
            
                    
                    SpringMVC
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.6" >
            
                <span>
            
                    
                    整合
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.6.1" data-path="../整合/Mybatis框架.html">
            
                <a href="../整合/Mybatis框架.html">
            
                    
                    Mybatis框架
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.6.2" data-path="../整合/SpringBoot.html">
            
                <a href="../整合/SpringBoot.html">
            
                    
                    SpringBoot
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.6.3" data-path="../整合/springmvc框架.html">
            
                <a href="../整合/springmvc框架.html">
            
                    
                    Springmvc框架
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.6.4" data-path="../整合/spring框架.html">
            
                <a href="../整合/spring框架.html">
            
                    
                    Spring框架
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../.." >006循环结构</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="while-&#x5FAA;&#x73AF;">while &#x5FAA;&#x73AF;</h1>
<p>&#x8BED;&#x6CD5;&#x7ED3;&#x6784;</p>
<pre><code class="lang-java">&#x521D;&#x59CB;&#x503C;&#xFF1B;
<span class="hljs-keyword">while</span>&#xFF08;&#x5FAA;&#x73AF;&#x6761;&#x4EF6;&#xFF09;{
    &#x4EE3;&#x7801;&#x5757;
}
</code></pre>
<p>&#x5FAA;&#x73AF;&#x89C4;&#x5F8B;</p>
<ol>
<li>&#x9996;&#x5148;&#x6267;&#x884C;1&#x6B21;&#x521D;&#x8BC6;&#x503C;&#x4EE3;&#x7801;</li>
<li>&#x5224;&#x65AD;&#x5FAA;&#x73AF;&#x6761;&#x4EF6;&#xFF0C;&#x5982;&#x679C;&#x5FAA;&#x73AF;&#x6761;&#x4EF6;&#x4E3A;true&#xFF0C;&#x5C31;&#x6267;&#x884C;{}&#x91CC;&#x9762;&#x7684;&#x5FAA;&#x73AF;&#x64CD;&#x4F5C;&#x4EE3;&#x7801;&#x548C;&#x8FED;&#x4EE3;&#x90E8;&#x5206;&#x7684;&#x4EE3;&#x7801;&#xFF0C;&#x8FED;&#x4EE3;&#x5B8C;&#x4E4B;&#x540E;&#xFF0C;&#x7EE7;&#x7EED;&#x8FD4;&#x56DE;&#x5224;&#x65AD;&#x5FAA;&#x73AF;&#x6761;&#x4EF6;&#xFF0C;&#x6839;&#x636E;&#x5FAA;&#x73AF;&#x6761;&#x4EF6;&#x7684;&#x7ED3;&#x679C;&#x51B3;&#x5B9A;&#x662F;&#x5426;&#x7EE7;&#x7EED;&#x6267;&#x884C;&#x5FAA;&#x73AF;&#x64CD;&#x4F5C;&#x5982;&#x679C;&#x5FAA;&#x73AF;&#x6761;&#x4EF6;&#x4E3A;false&#xFF0C;&#x5219;&#x7ED3;&#x675F;&#x6574;&#x4E2A;while&#x5FAA;&#x73AF;&#x7ED3;&#x6784;&#xFF0C;&#x7EE7;&#x7EED;&#x5F80;&#x4E0B;&#x6267;&#x884C;while&#x5FAA;&#x73AF;&#x7ED3;&#x6784;&#x4E4B;&#x540E;&#x7684;&#x4EE3;&#x7801;</li>
</ol>
<blockquote>
<pre><code>&#x6CE8;&#x610F;&#xFF1A;
</code></pre><p>1&#xFF09;&#x521D;&#x59CB;&#x503C;&#x4EE3;&#x7801;&#x53EA;&#x6267;&#x884C;&#x4E00;&#x6B21;
2&#xFF09;&#x5FAA;&#x73AF;&#x6761;&#x4EF6;&#x4E0D;&#x7BA1;&#x5199;&#x7684;&#x591A;&#x4E48;&#x7B80;&#x5355;&#x6216;&#x8005;&#x591A;&#x4E48;&#x590D;&#x6742;&#xFF0C;&#x7ED3;&#x679C;&#x90FD;&#x53EA;&#x80FD;&#x662F;&#x5E03;&#x5C14;&#x503C;&#xFF0C;&#x8981;&#x4E48;&#x4E3A;true&#x8981;&#x4E48;&#x4E3A;false
3&#xFF09;&#x8FED;&#x4EE3;&#x90E8;&#x5206;&#x7684;&#x4F5C;&#x7528;&#x662F;&#x6539;&#x53D8;&#x521D;&#x59CB;&#x503C;&#xFF0C;&#x8BA9;&#x5FAA;&#x73AF;&#x6761;&#x4EF6;&#x5728;&#x67D0;&#x4E00;&#x65F6;&#x523B;&#x4E0D;&#x518D;&#x6EE1;&#x8DB3;&#xFF0C;&#x4ECE;&#x800C;&#x7ED3;&#x675F;&#x6574;&#x4E2A;while&#x5FAA;&#x73AF;&#x7ED3;&#x6784;</p>
</blockquote>
<hr>
<h1 id="do-while&#x5FAA;&#x73AF;">do-while&#x5FAA;&#x73AF;</h1>
<p>&#x8BED;&#x6CD5;&#x7ED3;&#x6784;</p>
<pre><code class="lang-java">&#x521D;&#x59CB;&#x503C;&#xFF1B;
do{
    &#x4EE3;&#x7801;&#x5757;&#xFF1B;
}<span class="hljs-keyword">while</span>(&#x5FAA;&#x73AF;&#x6761;&#x4EF6;)&#xFF1B;
</code></pre>
<p>&#x8FD0;&#x884C;&#x89C4;&#x5F8B;</p>
<ol>
<li>&#x9996;&#x5148;&#x6267;&#x884C;1&#x6B21;&#x521D;&#x59CB;&#x503C;&#x4EE3;&#x7801;</li>
<li>&#x8FDB;&#x5165;{}&#x91CC;&#x6267;&#x884C;1&#x6B21;&#x5FAA;&#x73AF;&#x64CD;&#x4F5C;&#x548C;&#x8FED;&#x4EE3;&#x90E8;&#x5206;&#xFF0C;&#x6267;&#x884C;&#x5B8C;&#x4E4B;&#x540E;&#x8FDB;&#x884C;&#x6761;&#x4EF6;&#x5224;&#x65AD;&#xFF0C;&#x5982;&#x679C;&#x6761;&#x4EF6;&#x4E3A;true&#xFF0C;&#x8FD4;&#x56DE;{}&#x91CC;&#x6267;&#x884C;&#x5FAA;&#x73AF;&#x64CD;&#x4F5C;&#x548C;&#x8FED;&#x4EE3;&#x90E8;&#x5206;&#xFF0C;&#x5982;&#x679C;&#x6761;&#x4EF6;&#x4E3A;false&#xFF0C;&#x5219;&#x7ED3;&#x675F;&#x6574;&#x4E2A;do-while&#x5FAA;&#x73AF;&#x7ED3;&#x6784;&#xFF0C;&#x7EE7;&#x7EED;&#x5F80;&#x4E0B;&#x6267;&#x884C;do-while&#x5FAA;&#x73AF;&#x7ED3;&#x6784;&#x540E;&#x9762;&#x7684;&#x4EE3;&#x7801;<blockquote>
<p>&#x6CE8;&#x610F;&#xFF1A;
1) &#x521D;&#x59CB;&#x503C;&#x53EA;&#x6267;&#x884C;1&#x6B21;
2) &#x5FAA;&#x73AF;&#x6761;&#x4EF6;&#x4E0D;&#x7BA1;&#x5199;&#x7684;&#x591A;&#x4E48;&#x7B80;&#x5355;&#x8FD8;&#x662F;&#x590D;&#x6742;&#xFF0C;&#x90FD;&#x53EA;&#x80FD;&#x662F;&#x5E03;&#x5C14;&#x503C;&#xFF0C;&#x8981;&#x4E48;&#x4E3A;true&#xFF0C;&#x8981;&#x4E48;&#x4E3A;false
3) do-while&#x5FAA;&#x73AF;&#x662F;&#x5148;&#x6267;&#x884C;&#x4E00;&#x6B21;&#x5FAA;&#x73AF;&#x64CD;&#x4F5C;&#xFF0C;&#x518D;&#x5224;&#x65AD;&#x5FAA;&#x73AF;&#x6761;&#x4EF6;&#xFF0C;&#x56E0;&#x6B64;&#xFF0C;&#x5982;&#x679C;&#x7B2C;&#x4E00;&#x6B21;&#x5224;&#x65AD;&#x5FAA;&#x73AF;&#x6761;&#x4EF6;&#x5C31;&#x4E0D;&#x6EE1;&#x8DB3;&#xFF0C;&#x5FAA;&#x73AF;&#x64CD;&#x4F5C;&#x4E5F;&#x4F1A;&#x6267;&#x884C;&#x4E00;&#x6B21;&#xFF08;do-while&#x5FAA;&#x73AF;&#x91CC;&#x7684;&#x5FAA;&#x73AF;&#x64CD;&#x4F5C;&#x81F3;&#x5C11;&#x4F1A;&#x6267;&#x884C;&#x4E00;&#x6B21;&#xFF09; </p>
</blockquote>
</li>
</ol>
<hr>
<h1 id="&#x4E8C;&#x8005;&#x533A;&#x522B;">&#x4E8C;&#x8005;&#x533A;&#x522B;</h1>
<ol>
<li>&#x8BED;&#x6CD5;&#x4E0D;&#x540C;
<img src="https://img-blog.csdnimg.cn/b20ab135e726401f8460e2cfe24f106e.png" alt="&#x5728;&#x8FD9;&#x91CC;&#x63D2;&#x5165;&#x56FE;&#x7247;&#x63CF;&#x8FF0;"></li>
<li>&#x6267;&#x884C;&#x6B21;&#x5E8F;&#x4E0D;&#x540C;<ul>
<li>while &#x5148;&#x5224;&#x65AD;&#xFF0C;&#x540E;&#x6267;&#x884C;</li>
<li>do-while &#x5148;&#x6267;&#x884C;&#xFF0C;&#x540E;&#x5224;&#x65AD;</li>
</ul>
</li>
<li>&#x521D;&#x59CB;&#x6761;&#x4EF6;&#x4E0D;&#x6EE1;&#x8DB3;&#x5FAA;&#x73AF;&#x6761;&#x4EF6;&#x65F6;<ul>
<li>while &#x5FAA;&#x73AF;&#x4E00;&#x6B21;&#x90FD;&#x4E0D;&#x4F1A;&#x6267;&#x884C;</li>
<li>do-while &#x5FAA;&#x73AF;&#x4E0D;&#x7BA1;&#x4EFB;&#x4F55;&#x60C5;&#x51B5;&#x90FD;&#x81F3;&#x5C11;&#x6267;&#x884C;&#x4E00;&#x6B21;</li>
</ul>
</li>
</ol>
<h1 id="for-&#x5FAA;&#x73AF;">for &#x5FAA;&#x73AF;</h1>
<blockquote>
<p>&#x76F8;&#x8F83;&#x4E8E;while&#x5FAA;&#x73AF;&#x4F18;&#x52BF;
&#x5FAA;&#x73AF;&#x6B21;&#x6570;&#x56FA;&#x5B9A;&#xFF0C;&#x6BD4;while&#x66F4;&#x52A0;&#x7B80;&#x6D01;</p>
</blockquote>
<p>&#x8BED;&#x6CD5;&#x7ED3;&#x6784;&#xFF1A;</p>
<pre><code class="lang-java"><span class="hljs-keyword">for</span>(&#x521D;&#x59CB;&#x503C;;&#x5FAA;&#x73AF;&#x6761;&#x4EF6;;&#x8FED;&#x4EE3;&#x90E8;&#x5206;){
    &#x5FAA;&#x73AF;&#x64CD;&#x4F5C;
}
</code></pre>
<p><img src="https://img-blog.csdnimg.cn/db39a58f33b54695997f48a2e052fabf.png" alt="&#x5728;&#x8FD9;&#x91CC;&#x63D2;&#x5165;&#x56FE;&#x7247;&#x63CF;&#x8FF0;"></p>
<p>&#x6267;&#x884C;&#x89C4;&#x5F8B;&#xFF1A;
         1&#xFF09;&#x9996;&#x5148;&#x6267;&#x884C;1&#x6B21;&#x521D;&#x59CB;&#x503C;&#x4EE3;&#x7801;
         2&#xFF09;&#x5224;&#x65AD;&#x5FAA;&#x73AF;&#x6761;&#x4EF6;&#x662F;&#x5426;&#x6210;&#x7ACB;&#xFF0C;&#x5982;&#x679C;&#x5FAA;&#x73AF;&#x6761;&#x4EF6;&#x4E3A;true&#xFF0C;&#x5219;&#x6267;&#x884C;{}&#x91CC;&#x7684;&#x5FAA;&#x73AF;&#x64CD;&#x4F5C;&#x4EE3;&#x7801;&#xFF0C;&#x6267;&#x884C;&#x5FAA;&#x73AF;&#x64CD;&#x4F5C;&#x540E;&#xFF0C;&#x8FDB;&#x884C;&#x8FED;&#x4EE3;&#xFF0C;&#x8FED;&#x4EE3;&#x5B8C;&#x518D;&#x8FDB;&#x884C;&#x5FAA;&#x73AF;&#x6761;&#x4EF6;&#x5224;&#x65AD;&#xFF0C;&#x6839;&#x636E;&#x5FAA;&#x73AF;&#x6761;&#x4EF6;&#x7684;&#x7ED3;&#x679C;&#x51B3;&#x5B9A;&#x662F;&#x5426;&#x7EE7;&#x7EED;&#x6267;&#x884C;&#x5FAA;&#x73AF;&#x64CD;&#x4F5C;&#x5982;&#x679C;&#x5FAA;&#x73AF;&#x6761;&#x4EF6;&#x4E3A;false&#xFF0C;&#x5219;&#x7ED3;&#x675F;&#x6574;&#x4E2A;for&#x5FAA;&#x73AF;&#x7ED3;&#x6784;&#xFF0C;&#x7EE7;&#x7EED;&#x5F80;&#x4E0B;&#x6267;&#x884C;for&#x5FAA;&#x73AF;&#x7ED3;&#x6784;&#x4E4B;&#x540E;&#x7684;&#x4EE3;&#x7801;</p>
<blockquote>
<p>&#x6CE8;&#x610F;&#xFF1A;</p>
<blockquote>
<p>1&#xFF09;&#x521D;&#x59CB;&#x503C;&#x53EA;&#x6267;&#x884C;1&#x6B21;
2&#xFF09;&#x5FAA;&#x73AF;&#x6761;&#x4EF6;&#x53EA;&#x80FD;&#x662F;&#x5E03;&#x5C14;&#x503C;&#xFF0C;&#x8981;&#x4E48;&#x4E3A;true&#xFF0C;&#x8981;&#x4E48;&#x4E3A;false
3&#xFF09;&#x5982;&#x679C;&#x7B2C;&#x4E00;&#x6B21;&#x5224;&#x65AD;&#x5FAA;&#x73AF;&#x6761;&#x4EF6;&#x5C31;&#x4E0D;&#x6EE1;&#x8DB3;&#xFF0C;&#x90A3;&#x4E48;&#x5FAA;&#x73AF;&#x64CD;&#x4F5C;&#x4E00;&#x6B21;&#x90FD;&#x4E0D;&#x4F1A;&#x6267;&#x884C;</p>
</blockquote>
</blockquote>
<h1 id="&#x4F7F;&#x7528;for&#x5FAA;&#x73AF;&#x5E38;&#x89C1;&#x95EE;&#x9898;">&#x4F7F;&#x7528;for&#x5FAA;&#x73AF;&#x5E38;&#x89C1;&#x95EE;&#x9898;</h1>
<ol>
<li><p>&#x7F16;&#x8BD1;&#x9519;&#x8BEF;&#xFF1A;&#x53D8;&#x91CF; i &#x6CA1;&#x6709;&#x521D;&#x59CB;&#x5316;
 <img src="https://img-blog.csdnimg.cn/0bb1733a134a4d959bc29ff6b8dfdac9.png" alt="&#x5728;&#x8FD9;&#x91CC;&#x63D2;&#x5165;&#x56FE;&#x7247;&#x63CF;&#x8FF0;"></p>
</li>
<li><p>&#x7F3A;&#x5C11;&#x5FAA;&#x73AF;&#x6761;&#x4EF6;&#xFF0C;&#x6B7B;&#x5FAA;&#x73AF;
 <img src="https://img-blog.csdnimg.cn/d92f061a2eba41fa96f663ec87efa816.png" alt=""></p>
</li>
<li><p>&#x5FAA;&#x73AF;&#x53D8;&#x91CF;&#x4E0D;&#x4F1A;&#x53D1;&#x751F;&#x53D8;&#x5316;&#xFF0C;&#x4F1A;&#x5BFC;&#x81F4;&#x6B7B;&#x5FAA;&#x73AF;
 <img src="https://img-blog.csdnimg.cn/ba6d21b82bdd4917821604861a9ca3d5.png" alt="&#x5728;&#x8FD9;&#x91CC;&#x63D2;&#x5165;&#x56FE;&#x7247;&#x63CF;&#x8FF0;"></p>
</li>
<li><p>&#x5FAA;&#x73AF;&#x4E2D;&#x7F3A;&#x5C11;&#x5FC5;&#x8981;&#x7684;&#x5FAA;&#x73AF;&#x63A7;&#x5236;&#xFF0C;&#x4F1A;&#x9020;&#x6210;&#x6B7B;&#x5FAA;&#x73AF;
 <img src="https://img-blog.csdnimg.cn/98c1a4db49c14d539c7fdc07c99e2156.png" alt="&#x5728;&#x8FD9;&#x91CC;&#x63D2;&#x5165;&#x56FE;&#x7247;&#x63CF;&#x8FF0;"></p>
<h1 id="&#x603B;&#x7ED3;">&#x603B;&#x7ED3;</h1>
<blockquote>
<p>while do-while for &#x533A;&#x522B;</p>
</blockquote>
</li>
</ol>
<p><strong>&#x533A;&#x522B;&#x4E00;&#xFF1A;&#x8BED;&#x6CD5;&#x4E0D;&#x540C;</strong>
<img src="https://img-blog.csdnimg.cn/f24de48293864167a7dc65f8387e01f5.png" alt="&#x5728;&#x8FD9;&#x91CC;&#x63D2;&#x5165;&#x56FE;&#x7247;&#x63CF;&#x8FF0;">
<strong>&#x533A;&#x522B;&#x4E8C;&#xFF1A;&#x6267;&#x884C;&#x987A;&#x5E8F;&#x4E0D;&#x540C;</strong></p>
<ul>
<li>while &#xFF1A;&#x5148;&#x5224;&#x65AD;&#xFF0C;&#x5728;&#x6267;&#x884C;</li>
<li>do-while &#xFF1A;&#x5148;&#x6267;&#x884C;&#xFF0C;&#x5728;&#x5224;&#x65AD;</li>
<li>for&#xFF1A;&#x5148;&#x5224;&#x65AD;&#xFF0C;&#x5728;&#x6267;&#x884C;</li>
</ul>
<p><strong>&#x533A;&#x522B;&#x4E09;&#xFF1A;&#x4F7F;&#x7528;&#x60C5;&#x51B5;</strong></p>
<ul>
<li>&#x5FAA;&#x73AF;&#x6B21;&#x6570;&#x786E;&#x5B9A;&#x7684;&#x60C5;&#x51B5;&#xFF0C;&#x901A;&#x5E38;&#x7528;for&#x5FAA;&#x73AF;</li>
<li>&#x5FAA;&#x73AF;&#x6B21;&#x6570;&#x4E0D;&#x786E;&#x5B9A;&#x7684;&#x60C5;&#x51B5;&#xFF0C;&#x901A;&#x5E38;&#x7528;while&#x6216;&#x8005;do-while</li>
</ul>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="005选择结构.html" class="navigation navigation-prev " aria-label="Previous page: 005选择结构">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="007数组.html" class="navigation navigation-next " aria-label="Next page: 007数组">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"006循环结构","level":"2.1.6","depth":2,"next":{"title":"007数组","level":"2.1.7","depth":2,"path":"books/java/007数组.md","ref":"books/java/007数组.md","articles":[]},"previous":{"title":"005选择结构","level":"2.1.5","depth":2,"path":"books/java/005选择结构.md","ref":"books/java/005选择结构.md","articles":[]},"dir":"ltr"},"config":{"plugins":["search-pro","code","back-to-top-button","theme-comscore","intopic-toc","flexible-alerts","expandable-chapters"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"intopic-toc":{"selector":".markdown-section h1, .markdown-section h2, .markdown-section h3, .markdown-section h4, .markdown-section h5, .markdown-section h6","mode":"nested","maxDepth":6,"isCollapsed":true,"isScrollspyActive":true,"visible":true,"label":"In this article"},"search-pro":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"code":{"copyButtons":true},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"theme-comscore":{},"back-to-top-button":{},"flexible-alerts":{"style":"callout","note":{"label":"Note","icon":"fa fa-info-circle","className":"info"},"tip":{"label":"Tip","icon":"fa fa-lightbulb-o","className":"tip"},"warning":{"label":"Warning","icon":"fa fa-exclamation-triangle","className":"warning"},"danger":{"label":"Attention","icon":"fa fa-ban","className":"danger"}},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"expandable-chapters":{}},"theme":"default","author":"作者","lang":"zh-cn","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"isbn":"图书编号","variables":{},"title":"书名","gitbook":"*","description":"描述"},"file":{"path":"books/java/006循环结构.md","mtime":"2022-07-25T05:55:48.792Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2023-03-01T12:24:55.135Z"},"basePath":"../..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../../gitbook/gitbook.js"></script>
    <script src="../../gitbook/theme.js"></script>
    
        
        <script src="../../gitbook/gitbook-plugin-search-pro/jquery.mark.min.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-search-pro/search.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-code/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-back-to-top-button/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-intopic-toc/anchor.min.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-intopic-toc/gumshoe.polyfills.min.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-intopic-toc/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-flexible-alerts/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-expandable-chapters/expandable-chapters.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-theme-comscore/test.js"></script>
        
    

    </body>
</html>

